﻿
    using Maticsoft.BLL;
    using Maticsoft.Model;

    using System;
    using System.Collections.Generic;
    using System.Web.UI.HtmlControls;
    using Utils;

    public partial class WebPage_SheZhi_GongGaoList : FBasePage
    {

        public Maticsoft.BLL.Location locationbll = new Maticsoft.BLL.Location();
        public List<Maticsoft.Model.Location> locationlist = new List<Maticsoft.Model.Location>();
        public Maticsoft.Model.Location locationmodel = new Maticsoft.Model.Location();

        public void Delete(int id)
        {
            this.locationmodel.id = id;
            this.locationbll.Delete(id);
            base.SetSuccess("删除成功");
        }

        public string Get(string type)
        {
            if (type == "1")
            {
                return "首页显示";
            }
            if (type == "2")
            {
                return "右侧显示";
            }
            return "";
        }

        public void GetLocation()
        {
            this.locationlist = this.locationbll.GetModelList("");
        }

        public string GetVis(string location)
        {
            if (location == "1")
            {
                return "显示";
            }
            return "隐藏";
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.HeaderControl1.Select = "shezhi";
            this.SheZhi1.Select = "Go";
            if (!this.Page.IsPostBack)
            {
                if ((base.Request["deid"] != null) && Utility.IsNum(base.Request["deid"].ToString()))
                {
                    this.Delete(Convert.ToInt32(base.Request["deid"].ToString()));
                }
                this.GetLocation();
            }
        }
    }


